package models

import "database/sql"

type ExportXlsxTab3 struct {
	Code     string  `db:"code"`
	Lid      string  `db:"lid"`
	Name     string  `db:"name"`
	Unit     string  `db:"unit"`
	Quantity float64 `db:"quantity"`
	Mechanic float64 `db:"mechanic"`
	General  float64 `db:"general"`
}

type ExportXlsxTab4 struct {
	Code     string  `db:"code"`
	Name     string  `db:"name"`
	Unit     string  `db:"unit"`
	Quantity float64 `db:"quantity"`
	Price    float64 `db:"price"`
}

type ExportXlsxTab5 struct {
	SerialNumber string  `db:"serial_number"`
	Name         string  `db:"name"`
	Basis        string  `db:"basis"`
	TaxExcluded  float64 `db:"tax_excluded"`
	Tax          float64 `db:"tax"`
	TaxIncluded  float64 `db:"tax_included"`
	Remark       string  `db:"remark"`
}

// ExcelFillConfig Excel填充配置
type ExcelFillConfig struct {
	SheetName   string                   // 表名
	StartRow    int                      // 起始行（从1开始）
	RowsPerPage int                      // 每页行数
	ColumnMap   map[string]string        // 数据字段->Excel列的映射
	Data        []map[string]interface{} // 要填充的数据
	AutoSize    bool                     // 是否自动调整列宽
	WithHeader  bool                     // 是否包含表头
	HeaderRow   int                      // 表头行号
	HeaderNames map[string]string        // 自定义表头名称
}

// 设计审核
type ProjectReviewer struct {
	ID   string `db:"user_id" json:"user_id"`
	Name string `db:"user_name" json:"user_name"`
}

type ExportBase struct {
	Total                 string       `db:"total" json:"total" sheet:"工程立项" pos:"A3"`
	Name                  string       `db:"name" json:"name" sheet:"工程立项" pos:"B4"`
	DesignCode            string       `db:"design_code" json:"design_code" sheet:"工程立项" pos:"H4"`
	Initiator             string       `db:"initiator" json:"initiator" sheet:"工程立项" pos:"B5"`               //申报单位
	PreparationDate       sql.NullTime `db:"preparation_date" json:"preparation_date" sheet:"工程立项" pos:"E5"` // 编制日期
	Designer              string       `db:"designer" json:"designer" sheet:"工程立项" pos:"H5"`
	ProjectOverview       string       `db:"project_overview" json:"project_overview" sheet:"工程立项" pos:"B6"`
	TechnicalAnalysis     string       `db:"technical_analysis" json:"technical_analysis" sheet:"工程立项" pos:"B10"`
	BusinessType          string       `db:"business_type" json:"business_type" sheet:"工程立项" pos:"H14"` //业务类型（项目发起）
	PointOld              float64      `db:"point_old" json:"point_old" sheet:"工程立项" pos:"F16"`
	PointNew              float64      `db:"point_new" json:"point_new" sheet:"工程立项" pos:"F17"`
	PointCost             float64      `db:"point_cost" json:"point_cost" sheet:"工程立项" pos:"F18"`
	RecycleCycle          float64      `db:"recycle_cycle" json:"recycle_cycle" sheet:"工程立项" pos:"F19"`
	ProfitStatement       string       `db:"profit_statement" json:"profit_statement" sheet:"工程立项" pos:"G16"` // 收益说明
	Reviewer              string       `db:"reviewer" json:"reviewer" sheet:"封面" pos:"H15"`
	ConstructionType      string       `db:"construction_type" json:"construction_type" sheet:"封面" pos:"J10"` // 建设类型
	DesignType            string       `db:"design_type" json:"design_type" sheet:"封面" pos:"C6"`
	TitleConstructionName string       // 建设名称
	TitleProjectName      string       // 项目名称
	TimeBudget            sql.NullTime `db:"time_budget" json:"time_budget"`
	TimeSettle            sql.NullTime `db:"time_settle" json:"time_settle"`
	TimeAudit             sql.NullTime `db:"time_audit" json:"time_audit"`
}
